DimenPercent

class DimenPercent(val initialBaseDp: Float, val sortedCustomEntries: List<CustomDpEntry> = emptyList(), val ignoreMultiWindows: Boolean = false, val applyAspectRatio: Boolean = false, val customSensitivityK: Float? = null)

EN A class that allows defining custom dimensions based on screen qualifiers (UiModeType, Width, Height, Smallest Width).

The value is resolved using a Context and uses the base value or a custom value, applying dynamic scaling at the end.

PT Classe que permite a definição de dimensões customizadas baseadas em qualificadores de tela (UiModeType, Largura, Altura, Smallest Width).

Constructors

Link copied to clipboard
private constructor(initialBaseDp: Float, sortedCustomEntries: List<CustomDpEntry> = emptyList(), ignoreMultiWindows: Boolean = false, applyAspectRatio: Boolean = false, customSensitivityK: Float? = null)
constructor(initialBaseDp: Float)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
private val initialBaseDp: Float
Link copied to clipboard

Functions

Link copied to clipboard

EN Allow applying aspect ratio based constraint scaling. PT Permite aplicar o escalonamento restrito baseado na proporção da tela (aspect ratio).

Link copied to clipboard

EN Allow ignoring the constraint scaling based on multi-window resizing properties. PT Permite ignorar o escalonamento restrito baseado nas propriedades de redimensionamento de multi-janelas.

Link copied to clipboard
fun phdp(context: Context): Float
Link copied to clipboard
fun phdpBase(context: Context): Float
Link copied to clipboard
fun psdp(context: Context): Float
Link copied to clipboard
fun psdpBase(context: Context): Float

EN Get the resolved value in DP (as Float).

Link copied to clipboard

EN Resolves psdp, phdp, and pwdp in one pass (single UiModeType.fromConfiguration and config read). PT Resolve psdp, phdp e pwdp numa só passagem.

Link copied to clipboard
fun pwdp(context: Context): Float
Link copied to clipboard
fun pwdpBase(context: Context): Float
Link copied to clipboard
fun px(context: Context, qualifier: DpQualifier): Float

EN Resolves the final value in pixels (Float).

Link copied to clipboard
Link copied to clipboard
private fun resolveDp(context: Context, qualifier: DpQualifier): Float
Link copied to clipboard
private fun resolveDpInternal(context: Context, qualifier: DpQualifier, configuration: Configuration, currentUiModeType: UiModeType): Float
Link copied to clipboard
fun screen(orientation: Orientation = Orientation.DEFAULT, customValue: Float, finalQualifierResolver: DpQualifier? = null, inverter: Inverter? = Inverter.DEFAULT): DimenPercent
fun screen(orientation: Orientation = Orientation.DEFAULT, customValue: Number, finalQualifierResolver: DpQualifier? = null, inverter: Inverter? = Inverter.DEFAULT): DimenPercent
fun screen(type: UiModeType, customValue: Float, finalQualifierResolver: DpQualifier? = null, orientation: Orientation? = Orientation.DEFAULT, inverter: Inverter? = Inverter.DEFAULT): DimenPercent
fun screen(type: UiModeType, customValue: Number, finalQualifierResolver: DpQualifier? = null, orientation: Orientation? = Orientation.DEFAULT, inverter: Inverter? = Inverter.DEFAULT): DimenPercent
fun screen(type: DpQualifier, value: Int, customValue: Float, finalQualifierResolver: DpQualifier? = null, orientation: Orientation? = Orientation.DEFAULT, inverter: Inverter? = Inverter.DEFAULT): DimenPercent
fun screen(type: DpQualifier, value: Int, customValue: Number, finalQualifierResolver: DpQualifier? = null, orientation: Orientation? = Orientation.DEFAULT, inverter: Inverter? = Inverter.DEFAULT): DimenPercent
fun screen(uiModeType: UiModeType, qualifierType: DpQualifier, qualifierValue: Number, orientation: Orientation? = Orientation.DEFAULT, customValue: Float, finalQualifierResolver: DpQualifier? = null, inverter: Inverter? = Inverter.DEFAULT): DimenPercent
fun screen(uiModeType: UiModeType, qualifierType: DpQualifier, qualifierValue: Number, customValue: Number, finalQualifierResolver: DpQualifier? = null, orientation: Orientation? = Orientation.DEFAULT, inverter: Inverter? = Inverter.DEFAULT): DimenPercent